

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template
import os


from google.appengine.api import rdbms


'''
	Front page of app
	Get and post functions generate same page so app can be 
	use from appspot or facebook 
'''
class MainPage(webapp.RequestHandler):
	
	
	def get(self):
		
		path = os.path.join(os.path.dirname(__file__), 'html/index.html')
		self.response.out.write(template.render(path,''))
	

		
	def post(self):
		path = os.path.join(os.path.dirname(__file__), 'html/index.html')
		self.response.out.write(template.render(path,''))
	
	

def getRootDir(self):
		
	rootdir = os.path.join(os.path.dirname(__file__), '')
	return rootdir

application = webapp.WSGIApplication([('/', MainPage)], debug=True)


def main():
	run_wsgi_app(application)

if __name__ == "__main__":

	main()
